<?php
/* 
 * ebiz front
 * 
 * wishlist paginate View
 * 
 * @author allen
 * 
 */
?>

            <?php if(empty($wishlistInfo)){ ?>
            <div style="color:#;text-align:center;margin-top:30px;">您的收藏夹中还没有产品，快来添加吧。</div>
            <?php } ?>
            
            
            <!--产品循环开始-->
                <?php 
                    foreach ($wishlistInfo as $item) { 
                       $urlTitle = urlencode($item["url_title"])
                ?>
                <form method="post" id="wishlist_form_<?php echo $item["pi_id"]; ?>">
                
                <input type="hidden" id="hProductItemId_<?php echo $item["cw_id"]; ?>" value="<?php echo $item["pi_id"]; ?>" />
                <input type="hidden" id="hSalePrice_<?php echo $item["cw_id"]; ?>" value="<?php echo $item["sale_price"]; ?>" />
                <input type="hidden" id="hProductId_<?php echo $item["cw_id"]; ?>" value="<?php echo $item["p_id"]; ?>" />
                
                <div class="wl_item_div">
                    <div class="wl_item_image">
                        <a href="/p/<?php echo $urlTitle."/".$item["pi_id"]; ?>">
                            <?php if(empty($item["folder"]) || empty($item["name"])){ ?>
                            <img style="width:99px;height:99px;border:0px;" alt="" src="<?php echo ConfigConstants::getDefaultProductImagePath(120); ?>" />
                            <?php }else{ ?>
                            <img style="width:99px;height:99px;border:0px;" alt="" src="<?php echo ConfigConstants::getProductImagePath($item["folder"], $item["name"], 120); ?>" />
                            <?php } ?>
                        </a>
                    </div>
                    <div class="wl_item_desc">
                        <div class="wl_item_title">
                            <a href="/p/<?php echo $urlTitle."/".$item["pi_id"]; ?>">
                                <?php echo $item["title"]; ?>
                            </a>
                        </div>
                        <div class="wl_item_common">
                        
                            <?php if(empty($item["comment"])){ ?>
                            <div id="addcomment_<?php echo $item["cw_id"]; ?>">
                                <a onclick="javascript:WishlistContent.addcommon(<?php echo $item["cw_id"]; ?>);" >+添加备注</a>
                            </div>
                            <div id="submitComment_<?php echo $item["cw_id"]; ?>" style="display:none;">
                                <input type="text" id="comment_<?php echo $item["cw_id"]; ?>" value="<?php echo $item["comment"]; ?>" /> 
                                <input type="button" value="提交" onclick="javascript:WishlistContent.subcommon(<?php echo $item["cw_id"]; ?>);" />
                            </div>
                            <div id="showComment_<?php echo $item["cw_id"]; ?>" style="display:none;">
                                <span id="wishlistCommentInfo_<?php echo $item["cw_id"]; ?>"><?php echo $item["comment"]; ?></span>
                                <input type="button" value="编辑" onclick="javascript:WishlistContent.editcommon(<?php echo $item["cw_id"]; ?>);" />
                            </div>
                            <?php }else{ ?>
                            <div id="addcomment_<?php echo $item["cw_id"]; ?>" style="display:none;">
                                <a onclick="javascript:WishlistContent.addcommon(<?php echo $item["cw_id"]; ?>);" >+添加备注</a>
                            </div>
                            <div id="submitComment_<?php echo $item["cw_id"]; ?>" style="display:none;">
                                <input type="text" id="comment_<?php echo $item["cw_id"]; ?>" value="<?php echo $item["comment"]; ?>" /> 
                                <input type="button" value="提交" onclick="javascript:WishlistContent.subcommon(<?php echo $item["cw_id"]; ?>);" />
                            </div>
                            <div id="showComment_<?php echo $item["cw_id"]; ?>">
                                <span id="wishlistCommentInfo_<?php echo $item["cw_id"]; ?>"><?php echo $item["comment"]; ?></span>
                                <input type="button" value="编辑" onclick="javascript:WishlistContent.editcommon(<?php echo $item["cw_id"]; ?>);" />
                            </div>
                            <?php } ?>
                            
                        </div>
                        <div class="wl_item_time">
                            收藏时间：<?php echo $item["created"]; ?>
                        </div>
                    </div>
                    <div class="wl_item_price">
                        <div style="margin-left:auto;margin-right:auto; width:50px;"><?php echo UNIT.$item["sale_price"];?></div>
                    </div>
                    <div class="wl_item_opterate">
                        <div class="wl_cart_btn">
                            <input type="button" value="放入购物车" onclick="javascript:WishlistContent.addToCart('<?php echo $item["cw_id"]; ?>');" />
                        </div>
                        <div class="wl_del_btn">
                            <input type="button" value="取消收藏" onclick="javascript:WishlistContent.delWishlistItem(<?php echo $item["cw_id"]; ?>);"  />
                        </div>
                    </div>
                    <div class="clear"></div>
                </div>
                </form>
                <?php } ?>
                <!--产品循环结束-->
                
                <!-- 分页开始 -->
                <div class="p2_page">
                    <?php echo $headerPaginate; ?>
                </div>
                <!-- 分页结束 -->
            